package behavioral.strategy;

/**
 * @ClassName: MainTest
 * @Description: 测试类
 * @Author: liu-hao
 * @Date: 2023-04-13 00:11
 * @Version: 1.0
 **/
public class MainTest {
    public static void main(String[] args) {
        Context context = new Context(new OperationAdd());
        System.out.println("10 + 5 = " + context.executeStrategy(10, 5));

        context = new Context(new OperationSubtract());
        System.out.println("10 - 5 = " + context.executeStrategy(10, 5));

        context = new Context(new OperationMultiply());
        System.out.println("10 * 5 = " + context.executeStrategy(10, 5));
    }
}
